//
//  TLMsgTableViewCell.m
//  WXReader
//
//  Created by huaya on 2025/3/20.
//  Copyright © 2025 Andrew. All rights reserved.
//

#import "TLMsgTableViewCell.h"

@interface TLMsgTableViewCell ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleRightConst;

@end

@implementation TLMsgTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setModel:(TLMsgModel *)model{
    if (model) {
        _model = model;
        
        if ([model.readStatus isEqualToString:@"1"]) {
            self.isNewLab.hidden = self.isNewTagImgView.hidden = YES;
            self.titleRightConst.constant = 16;
        }else{
            self.isNewLab.hidden = self.isNewTagImgView.hidden = NO;
            self.titleRightConst.constant = 45;
        }
        
        self.timeLab.text = [NSDate convert2LocalTimeWithString:model.createTime andWithFormatter:@"yyyy-MM-dd"];
        
        self.titleLab.text = model.noticeTitle;
        
        self.secTitleLab.text = model.worksName;
        
        self.contentLab.text = model.desc;
        
        NSLog(@"contentLab:%@",model.desc);
        
        if ([model.coverPic isEqualToString:@""]) {
            self.contentImgView.hidden = YES;
        }else{
            self.contentImgView.hidden = NO;
            [self.contentImgView sd_setImageWithURL:[NSURL URLWithString:model.coverPic]];
        }
        
    }
}

@end
